//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;

namespace Eas.WebCrawler.Interfaces {
    /// <summary>Wraps details about a web request.</summary>
    public interface WebRequestInterface {
        /// <summary>Begins an asynchronous request for a web response from this request.</summary>
        /// <param name="callback">The callback function (if any) to call when the asynchronous request completes.</param>
        /// <param name="state">State to pass into the asynchronous callback.</param>
        /// <returns>The <see cref="IAsyncResult"/> from this call.</returns>
        IAsyncResult BeginGetResponse(AsyncCallback callback, object state);
        /// <summary>Completes an asynchronous request for a web response from this request.</summary>
        /// <param name="result">The <see cref="IAsyncResult"/> returned by the originating call to <see cref="BeginGetResponse"/>.</param>
        /// <returns>The <see cref="WebResponseInterface"/> which wraps the response to this request.</returns>
        WebResponseInterface EndGetResponse(IAsyncResult result);
        /// <summary>Aborts a web request.</summary>
        void Abort();
        /// <summary>The underyling <see cref="System.Net.WebRequest"/> which this interface wraps.</summary>
        System.Net.WebRequest WebRequest { get;}
    }
}
